package com.honour.service.interfaced.impl;

import java.util.List;


import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.honour.service.interfaced.HomePageInManager;
import com.system.dao.DaoSupport;
import com.system.util.PageData;

/**  首页相关方法实现类
 @Function
 @Author 于泓磊
 @Date   2017年11月15日
*/
@Service("homeinService")
public class HomePageInService implements HomePageInManager{
	
	
	@Resource(name = "daoSupport")
	private DaoSupport dao;

	/**
	 *  获得所有特权接口
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getPrivilegeList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.privilegelist", pd);
	}

	/**
	 * 获取对应特权的详情(仅马术，游艇，飞机，高尔夫，豪车)
	 */
	@Override
	public PageData getPrivilegeDet(PageData pd) throws Exception {
		return (PageData) dao.findForObject("HomeInMapper.privilegedet", pd);
	}

	/**
	 * 获得主页推荐列表接口
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getRecommendList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.recommendlist", pd);
	}

	/**
	 * 获得主页新闻列表接口
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getNewsTitleList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.newstitlelist", pd);
	}

	/**
	 * 获取主页新闻详情接口
	 */
	@Override
	public PageData getNewsDet(PageData pd) throws Exception {
		return (PageData) dao.findForObject("HomeInMapper.newsdet", pd);
	}

	/**
	 * 获取新闻评论列表接口
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getNewsEvaList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.newseva", pd);
	}

	/**
	 * 添加新闻评论接口
	 */
	@Override
	public void addNewsEva(PageData pd) throws Exception {
          dao.save("HomeInMapper.newsevaadd", pd)	;
	}

	/**
	 * 获取首页汇聚玩趴图片接口
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getPartyImg(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.getPartyImg", pd);
	}

	
	/**
	 * 首页荣耀杂志推荐接口
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getMagazineList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("MagazineInMapper.getMagazineList", pd);
	}

	/**
	 * 通过ID获取杂志
	 */
	@Override
	public PageData getMagazineById(PageData pd) throws Exception {
		return (PageData) dao.findForObject("MagazineInMapper.getMagazineById", pd);
	}

	/**
	 * 推荐相关杂志
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getMagazinesByRec(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("MagazineInMapper.getMagazinesByRec", pd);
	}

	/**
	 * 显示首页/尊购/汇聚→搜索的字
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getSearchListByParentId(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("SearchInMapper.getSearchListByParentId", pd);
	}

	/**
	 * 显示首页→搜索的图Bar
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getHomeSearchBarImg(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.getHomeSearchBarImg", pd);
	}

	/**
	 * 显示首页→搜索的图Food
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getHomeSearchFoodImg(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.getHomeSearchFoodImg", pd);
	}

	/**
	 * 显示首页→搜索的图KTV
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getHomeSearchKTVImg(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.getHomeSearchKTVImg", pd);
	}

	/**
	 * 显示首页→搜索的图Hotel
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getHomeSearchHotelImg(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.getHomeSearchHotelImg", pd);
	}

	/**
	 * 显示首页→搜索的图 Luxcar
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getHomeSearchLuxcarImg(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.getHomeSearchLuxcarImg", pd);
	}

	/**
	 * 显示首页→搜索的图 Yacht
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getHomeSearchYachtImg(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("HomeInMapper.getHomeSearchYachtImg", pd);
	}

	/**
	 * 更新用户经纬度地址
	 */
	@Override
	public void updTrapeze(PageData pd) throws Exception {
		 dao.save("HomeInMapper.updTrapeze", pd);
	}

	/**
	 * 获取版本号信息
	 * 该层直接选dao.方法名。
	 */
	@Override
	public PageData getAppVersion(PageData pd) throws Exception {
		return (PageData)dao.findForObject("HomeInMapper.getAppVersion", pd);
	}
	
	
	
	
	
}
